<?php
require_once("$_SERVER[DOCUMENT_ROOT]/conf/gconf.env.php");
require_once("Smarty.class.php");
class template extends Smarty {
    function template($skin=G_TEMPLATE_DIR) {
        // Class Constructor.
        // These automatically get set with each new instance.
        $this->Smarty();
        $this->template_dir = $skin;
        $this->config_dir = G_TEMPLATE_CONF_DIR;
        $this->cache_dir = G_TEMPLATE_CACHE_DIR;
        $this->compile_dir = G_TEMPLATE_COMPILE_DIR;  
        
        $this->caching = true;
        $smarty->compile_check = true;

        $rootDir = str_replace(DIRECTORY_SEPARATOR,'/',ROOT_DIR);
        $skinDir = str_replace(DIRECTORY_SEPARATOR,'/',$skin);
        $absoluteDir = str_replace($rootDir,'',$skinDir);
        $this->assign(array(
                            'tplp'      =>  $absoluteDir)
        );
    }
}
?>
